package com.bndg.bndggame;

import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.Toast;

import com.bndg.bndggame.bean.RankBean;
import com.ogaclejapan.smarttablayout.SmartTabLayout;

import java.util.ArrayList;
import java.util.List;

public class RankListActivity extends AppCompatActivity implements RankListFragment.OnListFragmentInteractionListener {

    private ViewPager vp_ranklist;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_rank_list);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        //显示那个箭头
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        toolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        vp_ranklist = findViewById(R.id.vp_ranklist);
        ArrayList<Integer> fragments = new ArrayList<>();
        fragments.add(3);
        fragments.add(4);
        fragments.add(5);
        List<String> titleList = new ArrayList<>();
        titleList.add("3*3");
        titleList.add("4*4");
        titleList.add("5*5");
        vp_ranklist.setAdapter(new MyAdapter(getSupportFragmentManager(), fragments, titleList));

        SmartTabLayout viewPagerTab = (SmartTabLayout) findViewById(R.id.viewpagertab);
        viewPagerTab.setViewPager(vp_ranklist);
    }

    @Override
    public void onListFragmentInteraction(RankBean.RanklistBean item) {
    }
}
